package cz.cvut.fit.web.nakupniSeznam.data;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

@Entity (name = "list")
@NamedQueries({
	@NamedQuery(name="list.getAll", query="SELECT l FROM list l"),
	@NamedQuery(name="list.getByOwner", query="SELECT l FROM list l WHERE l.owner= :owner"),
	@NamedQuery(name="list.getByOwnerAndId", query="SELECT l FROM list l WHERE l.owner= :owner AND l.id= :id"),
})
public class List implements IEntity {
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	
	private String name;
	
	private Long lastChanged;
	
	private String owner;
	

	@Override
	public Long getId() {
		return id;
	}

	public String getName() {
		return name;
	}
;
	public void setName(String name) {
		this.name = name;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getLastChanged() {
		return lastChanged;
	}

	public void setLastChanged(Long lastChanged) {
		this.lastChanged = lastChanged;
	}
	

	public String getOwner() {
		return owner;
	}

	public void setOwner(String owner) {
		this.owner = owner;
	}
}
